//
//  StepCell.m
//  ChampoinPeso
//
//  Created by mac on 2025/2/16.
//

#import "StepCell.h"
@interface StepCell()
@property (nonatomic,strong)UILabel *name;
@end
@implementation StepCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style
                reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = UIColor.clearColor;
        [self setupUI];
    }
    return self;
}

-(void)setupUI
{
    [self.contentView addSubview:self.name];
    [_name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.left.mas_offset(20);
    }];
    UIImageView *icon = [UIImageView new];
    icon.image =[UIImage imageNamed:@"go"];
    [self.contentView addSubview:icon];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.right.mas_offset(-20);
    }];
    UIView *line = [UIView new];
    line.backgroundColor = HexColor(@"#EFEFEF");
    [self.contentView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.right.mas_offset(-20);
        make.bottom.mas_offset(0);
        make.height.mas_equalTo(0.5);
    }];
}

-(UILabel *)name
{
    if (!_name) {
        _name = [UILabel new];
        _name.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
        _name.textColor = HexColor(@"#212121");
    }
    return _name;
}
-(void)setNameStr:(NSString *)nameStr
{
    _name.text = nameStr;
}
@end
